package com.searchlist.skiplist;

public class SkipListNode
{
	private String key;
	private SkipListNode nextNode;
	private SkipListNode previousNode;
	private SkipListNode belowNode;
	
	public SkipListNode(String key, SkipListNode nextNode, SkipListNode previousNode)
	{
		this.setKey(key);
		this.setNextNode(nextNode);
		this.setPreviousNode(previousNode);
	}
	
	public SkipListNode(String key)
	{
		this.setKey(key);
	}
	
	public String getKey()
	{
		return key;
	}
	
	public void setKey(String key)
	{
		this.key = key;
	}
	
	public SkipListNode getNextNode()
	{
		return nextNode;
	}
	
	public void setNextNode(SkipListNode nextNode)
	{
		this.nextNode = nextNode;
	}

	public SkipListNode getPreviousNode()
	{
		return previousNode;
	}

	public void setPreviousNode(SkipListNode previousNode)
	{
		this.previousNode = previousNode;
	}
	
	public SkipListNode getBelowNode()
	{
		return this.belowNode;
	}
	
	public void setBelowNode(SkipListNode belowNode)
	{
		this.belowNode = belowNode;
	}
	
	public String toString()
	{
		return "Key: " + this.key + ". \n Previous key: " + this.previousNode.getKey() + ". \n Next key: " + this.nextNode.getKey();
	}
}